<template>
  <div class="notice">
    <notice-summary v-show="type === types.notice">
      <template slot-scope="scope">
        <el-button type="text" @click="gotoDetail(scope.row)">分析</el-button>
      </template>
    </notice-summary>
    
    <notice-summary-detail ref="noticeSummaryDetail" />
  </div>
</template>

<script>
import NoticeSummary from './notice/notice-summary'
import NoticeSummaryDetail from './notice/notice-summary-detail'
export default {
  name: 'placard',
  components: {
    NoticeSummary, NoticeSummaryDetail
  },
  data () {
    return {
      type: 1,
      types: {
        notice: 1,
        detail: 2
      },
      selectNoticeId: null
    }
  },
  methods: {
    gotoDetail (notice) {
      this.$refs.noticeSummaryDetail.open(notice.noticeId)
    },
    goHome () {
      this.type = this.types.notice
    }
  }
}
</script>

<style>

</style>